package com.chinastock.log;

import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.ServerWebExchangeDecorator;

/**
 * @author zhangfan.it
 * @date 2021/2/3
 */
public class ExtractRequestBodyServerWebExchangeDecorator extends ServerWebExchangeDecorator {
    private final ExtractBodyServerHttpRequestDecorator extractBodyServerHttpRequestDecorator;

    protected ExtractRequestBodyServerWebExchangeDecorator(ServerWebExchange delegate, String excludes, boolean isOn) {
        super(delegate);
        extractBodyServerHttpRequestDecorator = new ExtractBodyServerHttpRequestDecorator(delegate.getRequest(), excludes, isOn);
    }

    @Override
    public ServerHttpRequest getRequest() {
        return extractBodyServerHttpRequestDecorator;
    }
}
